<?php
 
class BillOfMaterialsController extends Controller
{
	
	public function actionDelete()
	{
		$components = $_POST['component'];
		$itemId = $_POST['itemId'];
		
		$bom = new BillOfMaterials;
		
		foreach($components as $reference_id)
		{
			$bom->model()->deleteAll('reference_id=:referenceId', array(':referenceId'=>$reference_id));
		}
		
		$this->redirect(array("item/billOfMaterials/itemId/$itemId"));
		
	}
}